<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">

		<title>购物车页面</title>

		<link href="${ctxPath}/static/mall/AmazeUI-2.4.2/assets/css/amazeui.css" rel="stylesheet" type="text/css" />
		<link href="${ctxPath}/static/mall/basic/css/demo.css" rel="stylesheet" type="text/css" />
		<link href="${ctxPath}/static/mall/css/cartstyle.css" rel="stylesheet" type="text/css" />
		<link href="${ctxPath}/static/mall/css/optstyle.css" rel="stylesheet" type="text/css" />

		<script type="text/javascript" src="${ctxPath}/static/mall/js/jquery.js"></script>
<script type="text/javascript" src="${ctxPath!}/static/layer/layer.min.js"></script>
	</head>

	<body>
@layout("/mall/layout/mallTop.html"){}
			<div class="clear"></div>

			<!--购物车 -->
			<form method="post" id="order_form" name="order_form" action="${ctxPath!}/person/submitOrder">
			<div class="concent">
			<input type="hidden" value="1" id="addressid" name="addressid"/>
<input type="hidden" value="1" id="paymentid" name="paymentid"/>
				<div id="cartTable">
					<div class="cart-table-th">
						<div class="wp">
							<div class="th th-chk">
								<div id="J_SelectAll1" class="select-all J_SelectAll">

								</div>
							</div>
							<div class="th th-item">
								<div class="td-inner">商品信息</div>
							</div>
							<div class="th th-price">
								<div class="td-inner">单价</div>
							</div>
							<div class="th th-amount">
								<div class="td-inner">数量</div>
							</div>
							<div class="th th-sum">
								<div class="td-inner">金额</div>
							</div>
							<div class="th th-op">
								<div class="td-inner">操作</div>
							</div>
						</div>
					</div>
					<div class="clear"></div>
			
				@for(cart in cartList!){
					<tr class="item-list">
						<div class="bundle  bundle-last ">
							<input type="hidden" name="cartIds" value="${cart.id!}"/>
							<div class="clear"></div>
							<div class="bundle-main">
								<ul class="item-content clearfix">
									
									<li class="td td-item">
										<div class="item-pic">
											<a href="${ctxPath!}/front/goods/goodsDetail/${cart.id!}" target="_blank" data-title="${cart.goodsname!}" class="J_MakePoint" data-point="tbcart.8.12">
												<img src="${ctxPath!}/static/upload/project/${cart.img}" class="itempic J_ItemImg"></a>
										</div>
										<div class="item-info">
											<div class="item-basic-info">
												<a href="#" target="_blank" title="${cart.goodsname!}" class="item-title J_MakePoint" data-point="tbcart.8.11">${cart.goodsname!}</a>
											</div>
										</div>
									</li>
									<li class="td td-info">
										<div class="item-props item-props-can">
											
											<i class="theme-login am-icon-sort-desc"></i>
										</div>
									</li>
									<li class="td td-price">
										<div class="item-price price-promo-promo">
											<div class="price-content">
												<div class="price-line">
													<em class="price-original">${cart.price!}</em>
												</div>
												<div class="price-line">
													<em class="J_Price price-now" id="price" tabindex="0">${cart.price!}</em>
												</div>
											</div>
										</div>
									</li>
									<li class="td td-amount">
										<div class="amount-wrapper ">
											<div class="item-amount ">
												<div class="sl">
													<input class="min am-btn" onclick="changeV2()"  name="" type="button" value="-" />
													<input class="text_box" id="count" name="count" type="text" value="${cart.count!}" style="width:30px;" />
													<input class="add am-btn" onclick="changeV()" name="" type="button" value="+" />
												</div>
											</div>
										</div>
									</li>
									<li class="td td-sum">
										<div class="td-inner">
											<em tabindex="0" id="priceV" class="J_ItemSum number"></em>
										</div>
									</li>
									<li class="td td-op">
										<div class="td-inner">
											
											<a href="javascript:;" onclick="deleteC('${cart.id!}')" class="delete"> 删除</a>
										</div>
									</li>
								</ul>

							</div>
						</div>
					</tr>
					<div class="clear"></div>
					@}
					
				</div>
				<div class="clear"></div>

				

				<div class="footer">
					<div class="footer-hd">
						<p>
							<a href="#">zsCat科技</a>
							<b>|</b>
							<a href="#">商城首页</a>
							<b>|</b>
							<a href="#">支付宝</a>
							<b>|</b>
							<a href="#">物流</a>
						</p>
					</div>
					<div class="footer-bd">
						<p>
							<a href="#">关于zsCat</a>
							<a href="#">合作伙伴</a>
							<a href="#">联系我们</a>
							<a href="#">网站地图</a>
							<em>© 2015-2025 zsCat.com 版权所有</em>
						</p>
					</div>
				</div>

			</div>
</form>
			<!--操作页面-->

			<div class="theme-popover-mask"></div>

			<div class="theme-popover">
				<div class="theme-span"></div>
				<div class="theme-poptit h-title">
					<a href="javascript:;" title="关闭" class="close">×</a>
				</div>
				<div class="theme-popbod dform">
					<form class="theme-signin" name="loginform" action="" method="post">

						<div class="theme-signin-left">

							<li class="theme-options">
								<div class="cart-title">颜色：</div>
								<ul>
									<li class="sku-line selected">12#川南玛瑙<i></i></li>
									<li class="sku-line">10#蜜橘色+17#樱花粉<i></i></li>
								</ul>
							</li>
							<li class="theme-options">
								<div class="cart-title">包装：</div>
								<ul>
									<li class="sku-line selected">包装：裸装<i></i></li>
									<li class="sku-line">两支手袋装（送彩带）<i></i></li>
								</ul>
							</li>
							<div class="theme-options">
								<div class="cart-title number">数量</div>
								<dd>
									<input class="min am-btn am-btn-default" name="" type="button" value="-" />
									<input class="text_box" name="" type="text" value="1" style="width:30px;" />
									<input class="add am-btn am-btn-default" name="" type="button" value="+" />
									<span  class="tb-hidden">库存<span class="stock">1000</span>件</span>
								</dd>

							</div>
							<div class="clear"></div>
							<div class="btn-op">
								<div class="btn am-btn am-btn-warning">确认</div>
								<div class="btn close am-btn am-btn-warning">取消</div>
							</div>

						</div>
						<div class="theme-signin-right">
							<div class="img-info">
								<img src="${ctxPath}/static/mall/images/kouhong.jpg_80x80.jpg" />
							</div>
							<div class="text-info">
								<span class="J_Price price-now">¥39.00</span>
								<span id="Stock" class="tb-hidden">库存<span class="stock">1000</span>件</span>
							</div>
						</div>

					</form>
				</div>
			</div>
		<!--引导 -->
		<div class="navCir">
			<li><a href="home2.html"><i class="am-icon-home "></i>首页</a></li>
			<li><a href="sort.html"><i class="am-icon-list"></i>分类</a></li>
			<li class="active"><a href="shopcart.html"><i class="am-icon-shopping-basket"></i>购物车</a></li>	
			<li><a href="${ctxPath}/static/mall/person/index.html"><i class="am-icon-user"></i>我的</a></li>					
		</div>
		<script type="text/javascript">
		changeV1();
		function changeV1(){
			var count=parseInt($("#count").val());
			var price=$("#price").html();
			$("#priceV").html(count*price);
		}
		function changeV(){
			var count=parseInt($("#count").val())+1;
			var price=$("#price").html();
			$("#priceV").html(count*price);
		}
		function changeV2(){
			var count=parseInt($("#count").val())-1;
			var price=$("#price").html();
			$("#priceV").html(count*price);
		}
		function deleteC(id){
			$.ajax({
				type: "post",
		 		url: '${ctxPath}/person/deleteCart',
				data: {id:id},
				dataType: "json",
				success:function(data) {
					if(data.success){
							layer.msg("删除购车成功!",2,8);
							  window.location.reload();
					}else{
						layer.msg("删除购物车失败!",2,8);
					}
				}
			});
		}
function addCart(type){
	var goodsid=$("#goodsid").val();
	$.ajax({
		type: "post",
 		url: '${ctxPath}/person/addCart',
		data: {goodsid:goodsid},
		dataType: "json",
		success:function(data) {
			if(data.success){
				if(type==1){
					layer.msg("加入购车成功!",2,8);
				}else{
					var goodsid1=$("#goodsid").val();
					window.location.href = "${ctxPath!}/person/LikBuy/"+goodsid1;
				}
				
				
			}else{
				layer.msg("加入购物车失败!",2,8);
			}
		}
	});
}

</script>
	</body>

</html>